/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_pointageheuresup")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvPointageheuresup.findAll", query = "SELECT c FROM CvPointageheuresup c"),
    @NamedQuery(name = "CvPointageheuresup.findById", query = "SELECT c FROM CvPointageheuresup c WHERE c.id = :id"),
    @NamedQuery(name = "CvPointageheuresup.findByPointeur", query = "SELECT c FROM CvPointageheuresup c WHERE c.pointeur = :pointeur"),
    @NamedQuery(name = "CvPointageheuresup.findByDatedujour", query = "SELECT c FROM CvPointageheuresup c WHERE c.datedujour = :datedujour")})
public class CvPointageheuresup implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "pointeur")
    private String pointeur;
    @Basic(optional = false)
    @Column(name = "datedujour")
    @Temporal(TemporalType.DATE)
    private Date datedujour;
    @JoinColumn(name = "cv_travail_cv_travailleur_id", referencedColumnName = "cv_travailleur_id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTravail cvTravailCvTravailleurId;

    public CvPointageheuresup() {
    }

    public CvPointageheuresup(Integer id) {
        this.id = id;
    }

    public CvPointageheuresup(Integer id, String pointeur, Date datedujour) {
        this.id = id;
        this.pointeur = pointeur;
        this.datedujour = datedujour;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPointeur() {
        return pointeur;
    }

    public void setPointeur(String pointeur) {
        this.pointeur = pointeur;
    }

    public Date getDatedujour() {
        return datedujour;
    }

    public void setDatedujour(Date datedujour) {
        this.datedujour = datedujour;
    }

    public CvTravail getCvTravailCvTravailleurId() {
        return cvTravailCvTravailleurId;
    }

    public void setCvTravailCvTravailleurId(CvTravail cvTravailCvTravailleurId) {
        this.cvTravailCvTravailleurId = cvTravailCvTravailleurId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvPointageheuresup)) {
            return false;
        }
        CvPointageheuresup other = (CvPointageheuresup) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvPointageheuresup[ id=" + id + " ]";
    }
    
}
